﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SISGEZATBZVisual.BusinessEntities;

namespace SISGEZATBZVisual.Repository
{
    public class NivelMap:EntityTypeConfiguration<Nivel>
    {
        public NivelMap()
        {
            this.HasKey(r => r.Id);

            //propiedades
            this.Property(r => r.Id)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            this.Property(r => r.DescripcionNivel)
                .IsOptional().HasMaxLength(255);

            this.Property(r => r.NombreNivel)
               .IsRequired().HasMaxLength(70);


            //table
            this.ToTable("Nivel");


        }

    }
}
